#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main() {
    int n = 0;
    scanf("%d", &n);
    int arr[1000] = { 0 };
    int i = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
        int x = 0;
        int y = 0;
        while (arr[i])
        {
            if (arr[i] % 2 == 1)
            {
                x++;
            }
            else
            {
                y++;
            }
            arr[i] /= 2;
        }
        if (x % 2 == 0 && y % 2 != 0)
        {
            arr[i] = 1;
        }
        else if (y % 2 == 0 && x % 2 != 0)
        {
            arr[i] = 0;
        }
        else if (x % 2 == 0 && y % 2 == 0)
        {
            arr[i] = 10;
        }
        else
        {
            arr[i] = 100;
        }
    }
    for (i = 0; i < n; i++)
    {
        printf("%d ", arr[i]);
    }
    return 0;
}

#include <stdio.h>

int main() {
    long long t = 0;
    scanf("%lld", &t);
    while (t--)
    {
        long long n = 0, count = 0;
        scanf("%lld", &n);
        while (n)
        {
            n = n & (n - 1);
            count++;
        }
        long long num = 0;
        int i = 0;
        for (i = 0; i < count; i++)
        {
            num = num * 2 + 1;
        }
        printf("%lld %lld\n", count, num);
    }

    return 0;
}